<script setup lang="ts">
import { ref, watch } from 'vue'
import { useCommonStore } from '@/store'
const commonStore = useCommonStore()
// 调试输出
// console.log('commonStore:', commonStore.spinning);
// watch(() => commonStore.spinning, (newValue) => {
//   console.log('commonStorenewValue:', newValue);
// })
</script>

<template>
  <Teleport to="body">
    <div class="example" v-if="commonStore.spinning" >
      <a-spin class="spin"/>
    </div>
  </Teleport>

</template>
<style scoped>
.example {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 99999;
}
.spin{
  width: 30px;height: 30px;
  padding-left: 50%;
  padding-top: 44%;
  transform:  translate(-26px, 0);
 
}
</style>